package tech.aistar.service.newService.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.News;
import tech.aistar.mapper.news.NewsMapper;
import tech.aistar.service.newService.INewsService;

import java.util.List;

/**
 * Created by Administrator on 2019/9/27 0027.
 */
@Service
@Transactional
public class NewsServiceImpl implements INewsService {
    @Autowired
    private NewsMapper newsMapper;


    @Override
    public List<News> newsFindAll() {
        List<News> newsList = newsMapper.newsFindAll();
        return newsList;
    }

    @Override
    public List<News> newdelById(Integer id) {
        newsMapper.newdelById(id);
        return null;
    }

    @Override
    public void newsAdd(News news) {
        newsMapper.newsAdd(news);
    }

    @Override
    public  News newsFindOne(Integer id) {

        return newsMapper.newsFindOne(id);
    }
}
